import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)




const routes = [
  {
    path:"/dpage",
    component:()=>import("../page/dapage/dpage.vue"),
    children:[{
      path:"index",
      component:()=>import("../page/index/index.vue")
    },{
      path:"cart",
      component:()=>import("../page/shopping_cart/shopping_cart.vue")
    },{
      path:"sort",
      component:()=>import("../page/sort/sort.vue")
    },{
      path:"mine",
      component:()=>import("../page/mine/mine.vue")
    },{
      path:"",
      redirect: "index"
    }
  ]
  },{
    path:"/sign",
    component:()=>import("../page/sign_in/sign_in.vue")
  },{
    path:"/register",
    component:()=>import("../page/register/register.vue")
  },{
    path:"/productList",
    component:()=>import("../page/product_list/product_list.vue")
  },{
    path:"/productDetails",
    component:()=>import("../page/product_details/product_details.vue")
  },
  {
    path:"/order",
    component:()=>import("../page/order/order.vue")
  },
  {
    path:"/tureoder",
    component:()=>import("../page/tureorder/tureorder.vue")
  },
  {
    path:"/addorder",
    component:()=>import("../page/addorder/addorder.vue")
  },
  {
    path:"/home",
    component:()=>import("../page/home/home.vue")
  },
   //路由重定向
  {
    path:"*",
    redirect:"dpage"
  }

]

const router = new VueRouter({
  routes
})

export default router
